<?php 
namespace app\index\controller;
use think\Controller;
use think\Session;
use think\Request;
use think\Db;
class Course extends Controller
{
	public function index($cid)

	{	
		//某个用户的课程表 用户id 课程id 用户课程表记录订课信息和学习进度
		//1.显示单元
		
		$course = Db::name('myclass')->field('cname,cid')->where('uid',session('web')['uid'])->where('cid',$cid)->find();

		$unite = Db::name('courseunite')->where('pid','0')->where('courseid='.$cid)->select();
		// dump($unite);
		//2.显示进度 用户学了的打钩 
		return view('my_course/index',['unite'=>$unite,'cid'=>$cid,'course'=>$course]);
	}

	public function c_class($pid)
	{
		$class = Db::name('courseunite')->where('pid',$pid)->select();
		return $class;
	}


}